package com.wasu.entity.live;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>------------------------------------------------------
 * <p>Copyright (C) 2020 wasu company, All rights reserved.
 * <p>------------------------------------------------------
 * <p> 保存直播和回放播放地址集合和鉴权ppv
 * <p>
 *
 * @author Created by zhangmz
 * @date on 2023/8/1
 */
public class WasuIpLiveUrl implements Parcelable {

    /**
     * 直播产品id，用来鉴权
     */
    private String ppvid;

    /**
     * 回放产品id
     */
    private String hfPpvId;

    /**
     * 保存直播播放地址列表
     */
    private List<LivePlayUrls> livePlayUrls = new ArrayList<>();

    /**
     * 回放播放地址列表
     */
    private List<TsPlaybackUrls> tsPlaybackUrls = new ArrayList<>();

    public WasuIpLiveUrl(){

    }

    public WasuIpLiveUrl(String ppvid, String hfPpvId, List<LivePlayUrls> livePlayUrls, List<TsPlaybackUrls> tsPlaybackUrls) {
        this.ppvid = ppvid;
        this.hfPpvId = hfPpvId;
        this.livePlayUrls = livePlayUrls;
        this.tsPlaybackUrls = tsPlaybackUrls;
    }

    protected WasuIpLiveUrl(Parcel in) {
        ppvid = in.readString();
        hfPpvId = in.readString();
        livePlayUrls = in.createTypedArrayList(LivePlayUrls.CREATOR);
        tsPlaybackUrls = in.createTypedArrayList(TsPlaybackUrls.CREATOR);
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(ppvid);
        dest.writeString(hfPpvId);
        dest.writeTypedList(livePlayUrls);
        dest.writeTypedList(tsPlaybackUrls);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<WasuIpLiveUrl> CREATOR = new Creator<WasuIpLiveUrl>() {
        @Override
        public WasuIpLiveUrl createFromParcel(Parcel in) {
            return new WasuIpLiveUrl(in);
        }

        @Override
        public WasuIpLiveUrl[] newArray(int size) {
            return new WasuIpLiveUrl[size];
        }
    };

    public String getPpvid() {
        return ppvid;
    }

    public void setPpvid(String ppvid) {
        this.ppvid = ppvid;
    }

    public String getHfPpvId() {
        return hfPpvId;
    }

    public void setHfPpvId(String hfPpvId) {
        this.hfPpvId = hfPpvId;
    }

    public List<LivePlayUrls> getLivePlayUrls() {
        return livePlayUrls;
    }

    public void setLivePlayUrls(List<LivePlayUrls> livePlayUrls) {
        this.livePlayUrls = livePlayUrls;
    }

    public List<TsPlaybackUrls> getTsPlaybackUrls() {
        return tsPlaybackUrls;
    }

    public void setTsPlaybackUrls(List<TsPlaybackUrls> tsPlaybackUrls) {
        this.tsPlaybackUrls = tsPlaybackUrls;
    }

    @Override
    public String toString() {
        return "WasuIpLiveUrl{" +
                "ppvid='" + ppvid + '\'' +
                ", hfPpvId='" + hfPpvId + '\'' +
                ", livePlayUrls=" + livePlayUrls +
                ", tsPlaybackUrls=" + tsPlaybackUrls +
                '}';
    }
}
